Okay.
In this lecture, we're going to be taking a quick look at the lighting service, which allows you to
customize lighting in your game.
And we're just going to jump right into this and go into the first property of the lighting service,
which is the ambient property.
What does this do?
Well, what this does is it changes the hue or the color of the light in the regions that are occluded
from the sky.
So any area that does not have direct visibility to the sky.
So this shadowed area here, since it does not have direct visibility to the sky, if I change this
ambient color, then whatever color here of the shadow is going to change.
So if I want to make it darker, the shadow darker, I can decrease the color here.
And as you can see, my shadow changes.
Now, something interesting to note about this is that there's this other property here called Outdoor
Ambient.
And this is for areas that are not occluded from the sky.
So all these surfaces that are directly facing the sky.
This property here, this outdoor ambient property, is going to be affecting those.
And this property has to be equal to or greater than the values that are in the ambient property.
So let's say I want to make the outside super bright.
Then I can go in here and I can change any of the colors in this property here.
So let me just increase it here.
And you see, I can change the color of the shadow around.
But once I increase the numbers to be greater than any of the numbers in here, it's going to also change
my outdoor ambient.
So you might notice that when I increase the brightness of the secluded area, you'll notice that the
brightness of the surrounding areas also increase.
And that's because these numbers are becoming higher than the outdoor ambient.
So once this ambient property becomes greater than the outdoor ambient colors, then this one takes
priority over everything.
So if you want to customize your shadows, you're going to want to make sure that any of the RGV values
in here are lower than or equal to this outdoor ambient.
So this controls the color of light in the non occluded areas of the map.
So if I wanted to make light like green, let's make it green.
And then I could go in here and make my shadows something like maybe blue or purple.
When you do something like that.
So I've got green light and purple or bluish shadows.
And I'm going to undo all that.
The next one here is brightness.
This one's pretty simple.
It's just how bright the lighting is in your game.
So if I decrease it to one, as you can see, my game gets darker.
And if I increase it to something like ten.
The light is much brighter.
So very simple property.
The next property here is called Color shift.
Bottom.
And what this does is that it affects the hue of light that is reflected by surfaces not directly facing
the sun.
So basically this surface here, because it's directly facing the sun, this would not be affected by
this property, but this face here that is not directly facing the sun, it's got a shadow on it will
be affected by this property.
So if I change the technology here to something like Voxel, you'll be able to see it easier.
But once I start changing the color of this, you'll see the color of the shadow here or the the light
being reflected by this face of my block change.
So if I make it something like.
Maybe red.
You'll see how this face gets red.
And it's only this face that is not directly looking towards the sun.
Same thing with underneath here.
You can kind of see how each of these faces that are not directly facing my sun are becoming red.
And then for the color shift top, this is for all the faces that are directly facing the sun.
And I'm pretty sure you can see this one in shadow map.
So if I change the hue here, you'll see if I do something like yellow.
Or something like that.
You can see that all of the areas that have direct visibility to the sun have changed to this bluish
hue.
Right.
But all of these faces that aren't directly facing towards the sun don't have that change.
So as you can see, when I change this, this face is not affected at all.
It only gets affected by this property right here.
So just a reminder, this one is for the faces of parts that are facing arson.
And this is for the faces of parts that are not facing the sun.
The next property here is called Environment Diffuse Scale.
And this one kind of.
This one basically dictates how much light comes from the environment of your game.
So how much brightness is coming from reflected objects?
Because as you know, light can bounce off objects and illuminate other objects.
But if I decrease this, if I place it to zero, you notice everything gets a lot dimmer.
And that's because the light being reflected off of these parts are not illuminating My other parts,
it's reducing how much light is coming from reflections in my game.
This other one called Environment Specular Scale is this one's a property basically, I think mainly
for like metallic objects.
It kind of changes the reflectivity of like light bouncing off stuff.
So a way to demonstrate this is that I could make a sphere here and I'm going to make it metal.
So right now, as you can see, my metal is pretty reflective.
But if I go and start decreasing this value here, you'll notice that my metal becomes less and less
reflective to the point where there isn't much of a mirror like effect to my metal.
But as I increase this, you'll notice that my metal becomes shinier and shinier.
And you can kind of notice The Shining being applied to all our parts.
As you can see, all our parts are becoming more shiny.
But this mainly affects metallic parts.
And we'll just leave it at the default for now.
The other property here is called Global Shadows.
And this sets whether or not objects can cast shadows.
And it basically allows us to differentiate between indoor and outdoor settings.
So if I disable this, the game sees this area that is being blocked by this part as no different from
its surroundings.
Right.
This part is basically not casting any shadow.
We don't have any distinction between indoor and outdoor areas.
So if you leave this checked, then you can have different lighting inside of areas that are covered
like in caves or in a house or whatever the case may be.
The next property here is shadow softness, and this dictates how sharp the edges of shadows are going
to be.
So if I set this to zero, you can see that my shadows become very sharp.
But as I increase this number, you'll notice that it becomes blurrier and blurrier and the line from
shadow to light doesn't become as defined.
It's blurry, right?
So we'll leave this at the default of 0.2.
Now, this other setting here, technology, this just changes which lighting system is going to be
used for the game.
The most realistic one is future lighting, but it's also the it's the most demanding performance wise
of the technologies.
So the default is shadow map.
And there's some other ones in here called voxel and compatibility.
So we'll just leave it on shadow map for now, though.
Clock time, very simple.
Just represents the number of hours in our game.
So if I set it to 16, the time of day is currently at the 16th hour of the 24 hours in a day.
If I set it to one, you can think of that as like 1:00 AM and then we have like 2 a.m., 3:00 AM,
here is the afternoon and then this is 1:00 and so on.
Geographic latitude represents the degree position of your latitude in your game.
So zero is at the equator if you are on earth, zero degrees of latitude means you're on the equator.
If this number starts increasing in the positive direction, that means you're going towards the northern
hemisphere.
And if it's going in the negative direction, you're going towards the southern hemisphere.
And this changes the positioning of the sun in our game.
So if we're at noon here right on the equator, the sun is basically almost directly overhead.
But if we change our latitude to be something maybe more northerly, if we set it to something like
45 degrees of latitude, you can see that our sun has shifted dramatically to a different direction.
And we can keep changing this.
We could go super high, up 65 degrees of latitude.
Or we could go to 85 degrees latitude.
And it's just changing the positioning of the sun for us.
And we can also do the same.
We can go in the southern hemisphere, go like -45.
And again, the sun's position changes.
Time of day gives you greater control for the time that you want your game to be.
So I could set it to be like maybe eight in the morning, so eight and then maybe 837.
And then we can set like a number of seconds here, like 44.
And then it updates that in the clock time as well.
But this just gives you easier control over the time instead of it being represented by some obscure
decimal number.
And then this last property here is called exposure compensation.
And this goes from, I believe, negative three to positive three.
Can it go higher than that?
Yeah, it can.
I'm pretty sure it goes.
What is the max?
Well, actually, I think I can go super high.
Whatever.
What this property does is it dictates how much light your camera observes.
If you've ever noticed, like if you go outside when it's super sunny out and then you go back inside
a building, you'll notice that the building is super dark.
And the reason for that is because your pupils have constricted so much that they're barely letting
any light through and they have to sit there and adjust to open back up to let more light into your
eyes so you can see more clearly.
This is what this property basically does.
It changes how much light our camera here is taking in for our game.
So if I want the camera to take in less light, like imagine your pupils are extremely constricted,
I could set it to something like negative five and you can barely see anything.
But let's say your pupils are super wide open and it's taken in a lot of light.
I could set it to five and you can barely see.
Right.
So that's what that property does.
And other than that, that's kind of the basic properties for lighting.
There's also some other effects in here post-processing effects such as bloom, depth of field sunrays.
We're not going to go too in depth into these if you want to learn more about them.
I've attached articles to this lecture that you can go ahead and take a look at.
But for Sunrays, this just changes the intensity of sunrays in your game.
So if I said it's something like one super bright sun rays, you can see them glistening here as I move
around the part.
And if I actually go ahead and delete all of these, leave it to kind of the default and we go back
into the lighting service.
You'll see we got this new section right here.
Fog.
Now, the fog here you can use to create some fog.
So it has a starting point and an ending point.
And we can set this ending point to be something closer, like 100 studs away.
And basically our starting point is at our camera.
And the further we get away from the camera, the fog gets thicker and thicker until it reaches the
max point, which is 100 studs away.
And that's when the fog becomes the thickest.
If you want to create a zone around the player that isn't foggy, you could set this fog start to be
something like ten.
And as you can see, I have a ten stud zone around me where there isn't any fog.
It only starts becoming foggy after it hits or exceeds that ten stud limit.
And of course, you can also change the color of your fog as well to whatever color you'd like.
So yeah.
Kind of cool.
The lighting service, as you can see, is pretty neat and you can change a lot of stuff in here to
change the lighting of your game.
Other than that, that's all I have for you in this lecture.